//
//  RecycleScrollCollectionReusableView.m
//  NewMusic
//
//  Created by dllo on 15/11/20.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "RecycleScrollCollectionReusableView.h"
#import "WheelView.h"
@interface RecycleScrollCollectionReusableView ()<pushToWheelDetailPro>
@property(nonatomic, retain) WheelView *scrollView;
@end


@implementation RecycleScrollCollectionReusableView
- (void)dealloc {
    [_picArray release];
    [_scrollView release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame {
    self =[super initWithFrame:frame];
    if (self) {
        self.picArray = [NSMutableArray array];
    }
    return self;
}
#pragma mark 创建视图
- (void)createSubView {
    self.scrollView = [[WheelView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    _scrollView.delegatePush = self;
    [self addSubview:_scrollView];
    if (_picArray.count != 0) {
        _scrollView.wheelArr = _picArray;
    }
    [_scrollView release];
}
#pragma mark 重写picArray的setter方法
- (void)setPicArray:(NSMutableArray *)picArray {
    if (_picArray != picArray) {
        [_picArray  release];
        _picArray = [picArray retain];
    }
    [self createSubView];
}
#pragma mark 代理方法
-(void)pushToWheelDetailView:(ListenDataModel *)listenDataModel {
    [self.delegate recycleScrollViewClickedAction:listenDataModel];
}
@end
